//
//  ActivityListCell.m
//  UI_豆瓣
//
//  Created by WangZe on 15/10/12.
//  Copyright © 2015年 王泽龙. All rights reserved.
//

#import "ActivityListCell.h"
#define HEIGHT self.contentView.frame.size.height
#define WIDTH self.contentView.frame.size.width
@implementation ActivityListCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}
- (void)createView{
    //创建
    self.view = [[UIView alloc]init];
    [self.contentView addSubview:self.view];
    self.view.backgroundColor = [UIColor colorWithRed:196 / 255.0 green:215 / 255.0 blue:223 / 255.0 alpha:1];
    [_view release];
    self.viewSecond = [[UIView alloc] init];
    [self.view addSubview:self.viewSecond];
    [_viewSecond release];
    self.labelTitle = [[UILabel alloc] init];
    [self.view addSubview:self.labelTitle];
    [_labelTitle release];
    self.labelTime = [[UILabel alloc] init];
    self.imageTime = [[UIImageView alloc] init];
    [self.viewSecond addSubview:self.imageTime];
    [_imageTime release];
    self.labelTime = [[UILabel alloc] init];
    [self.viewSecond addSubview:self.labelTime];
    [_labelTime release];
    self.imageAdress = [[UIImageView alloc] init];
    [self.viewSecond addSubview:self.imageAdress];
    [_imageAdress release];
    self.labelAdress = [[UILabel alloc] init];
    [self.viewSecond addSubview:self.labelAdress];
    [_labelAdress release];
    self.labelType = [[UILabel alloc] init];
    self.imageType = [[UIImageView alloc] init];
    [self.viewSecond addSubview:self.imageType];
    [_imageType release];
    self.labelType = [[UILabel alloc] init];
    [self.viewSecond addSubview:self.labelType];
    [_labelType release];
    self.imageMovie = [[UIImageView alloc] init];
    [self.viewSecond addSubview:self.imageMovie];
    [_imageMovie release];
    self.labelLike = [[UILabel alloc] init];
    [self.viewSecond addSubview:self.labelLike];
    [_labelLike release];
}
- (void)layoutSubviews{
    [super layoutSubviews];
    self.view.frame = CGRectMake(5, 10, WIDTH - 10, HEIGHT - 20);
    self.view.layer.borderWidth = 0.5;
    self.view.layer.cornerRadius = 10;
    
    self.viewSecond.frame = CGRectMake(3, 40, WIDTH - 16, HEIGHT- 65);
    self.viewSecond.layer.borderWidth = 0.5;
    self.viewSecond.layer.cornerRadius = 10;
    self.viewSecond.backgroundColor = [UIColor whiteColor];
    self.labelTitle.frame = CGRectMake(0, 0, WIDTH - 10, 45);
    self.imageTime.frame = CGRectMake(3, 5, 30, 25);
    
    self.labelTime.frame = CGRectMake(35, 5, WIDTH - 16 - 100 - 38, 25);
    
    self.imageAdress.frame = CGRectMake(3, 35, 30, 25);
    self.labelAdress.frame = CGRectMake(35, 35, WIDTH - 16 - 100 - 38, 25);
    self.imageType.frame = CGRectMake(3, 65, 30, 25);
    
    self.labelType.frame = CGRectMake(35, 65, WIDTH - 16 - 100 - 38, 25);
    
    self.imageMovie.frame = CGRectMake(WIDTH - 114, 5, 95 , HEIGHT - 65 - 10);
 
    self.labelLike.frame = CGRectMake(5, 100, WIDTH - 16 - 100 - 38, 26);
    
    self.labelLike.font = [UIFont systemFontOfSize:14];
    self.labelTime.font = [UIFont systemFontOfSize:14];
    self.labelType.font = [UIFont systemFontOfSize:14];
    self.labelAdress.font = [UIFont systemFontOfSize:14];
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
